package com.github.catvod.spider;

import com.github.catvod.crawler.Spider;
import com.github.catvod.parser.C0000;
import com.github.catvod.parser.C0001;
import com.github.catvod.parser.C0002;
import com.github.catvod.parser.C0003;
import com.github.catvod.parser.C0004;
import com.github.catvod.parser.C0005;
import com.github.catvod.parser.C0006;
import com.github.catvod.parser.C0007;
import com.github.catvod.parser.C0008;
import com.github.catvod.parser.C0009;
import com.github.catvod.spider.merge.C0011;
import com.github.catvod.spider.merge.C0013;
import com.github.catvod.spider.merge.C0014;
import com.github.catvod.spider.merge.C0015;
import com.github.catvod.spider.merge.fP;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;

/* loaded from: classes.dex */
public class AI extends Spider {

    /* renamed from: short, reason: not valid java name */
    private static final short[] f10short = {1162, 1196, 1210, 1197, 1266, 1182, 1208, 1210, 1201, 1195, 2533, 2556, 2551, 2508, 2531, 2559, 2546, 2538, 2508, 2534, 2529, 2559, 2626, 2651, 2640, 2667, 2628, 2648, 2645, 2637, 2667, 2642, 2630, 2651, 2649, 2308, 2333, 2326, 2349, 2321, 2333, 2332, 2310, 2327, 2332, 2310, 653, 660, 671, 676, 671, 658, 649, 670, 664, 655, 660, 649, 952, 929, 938, 913, 943, 941, 954, 929, 956, 2658, 2683, 2672, 2635, 2662, 2673, 2681, 2677, 2662, 2687, 2663, 1310, 1287, 1292, 1335, 1289, 1306, 1293, 1289, 1495, 1486, 1477, 1534, 1496, 1476, 1472, 1491, 2375, 2398, 2389, 2414, 2369, 2392, 2386, 2372, 2397, 2390, 2413, 2396, 2387, 2399, 2391, 2274, 2299, 2288, 2251, 2301, 2288, 1993, 1996, 2006, 2001, 2098, 2082, 2172, 2174, 2080, 2169, 2168, 2153, 2172, 2164, 2161, 2107, 2164, 2169, 2158, 2080, 548, 553, 544, 565, 527, 574, 561, 573, 565, 1428, 1421, 1414, 1469, 1409, 1422, 1411, 1425, 1425, 1714, 1682, 2386, 2405, 2406, 2405, 2418, 2405, 2418, 1431, 1492, 1418, 1484, 1409, 1472, 1485, 1481, 1484, 1485, 1498, 1269, 1261, 1253, 1259, 1262, 1261, 947, 948, 938, 2025, 2040, 2027, 2026, 2044, 1448, 1515, 1526, 1458, 943, 957, 2128, 2121, 2114, 2169, 2132, 2115, 2123, 2119, 2132, 2125, 2133, 2300, 2277, 2286, 2261, 2298, 2275, 2281, 1335, 1326, 1317, 1310, 1327, 1312, 1324, 1316, 1446, 1471, 1460, 1423, 1465, 1460, 2217, 2220, 2230, 2225, 1872, 1856, 1822, 1820, 1858, 1801, 1814, 1819, 1818, 1808, 1811, 1814, 1804, 1803, 1881, 1800, 1819, 1858};
    private String h = "";
    private String V0 = "";
    private String j = "";

    public AI() {
        int m10 = C0003.m10();
        int i = 1616;
        while (true) {
            i ^= 1633;
            switch (i) {
                case 14:
                case 49:
                    i = m10 <= 0 ? 1709 : 1678;
                case 204:
                    System.out.println(C0006.m23("j8J6mS5tTpD33j3a15s5a1vjxgTwu"));
                    break;
                case 239:
                    break;
            }
            return;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:18:0x0032, code lost:
    
        return r3;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private java.util.HashMap<java.lang.String, java.lang.String> h(java.lang.String r7) {
        /*
            r6 = this;
            r0 = 0
            java.lang.String r1 = "ۢۧۥ"
            r2 = r0
            r3 = r0
            r4 = r1
            r1 = r0
        L7:
            int r4 = com.github.catvod.parser.C0006.m20(r4)
            switch(r4) {
                case 1747652: goto L2c;
                case 1749824: goto L13;
                case 1750660: goto L20;
                case 1754625: goto L1b;
                case 1754659: goto L32;
                default: goto Le;
            }
        Le:
            java.lang.String r2 = r6.V0
            java.lang.String r4 = "ۧۧۡ"
            goto L7
        L13:
            java.util.HashMap r3 = new java.util.HashMap
            r3.<init>()
            java.lang.String r4 = "ۢۢۢ"
            goto L7
        L1b:
            short[] r1 = com.github.catvod.spider.AI.f10short
            java.lang.String r4 = "ۣۣۤ"
            goto L7
        L20:
            r0 = 0
            r4 = 10
            r5 = 1247(0x4df, float:1.747E-42)
            java.lang.String r0 = com.github.catvod.parser.C0001.m3(r1, r0, r4, r5)
            java.lang.String r4 = "ۣ۠۟"
            goto L7
        L2c:
            r3.put(r0, r2)
            java.lang.String r4 = "ۧۨۤ"
            goto L7
        L32:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: com.github.catvod.spider.AI.h(java.lang.String):java.util.HashMap");
    }

    public String detailContent(List<String> list) {
        String m17 = C0005.m17(f10short, 10, 12, 2451);
        String m43 = C0014.m43(f10short, 22, 13, 2612);
        String m47 = C0015.m47(f10short, 35, 11, 2418);
        String m3 = C0001.m3(f10short, 46, 12, 763);
        String m1 = C0000.m1(f10short, 58, 9, 974);
        String m27 = C0008.m27(f10short, 67, 11, 2580);
        String m30 = C0009.m30(f10short, 78, 8, 1384);
        String m432 = C0014.m43(f10short, 86, 8, 1441);
        String m32 = C0001.m3(f10short, 94, 7, 2353);
        String m41 = C0013.m41(f10short, 101, 8, 2354);
        String m35 = C0011.m35(f10short, 109, 6, 2196);
        String m302 = C0009.m30(f10short, 115, 4, 1957);
        try {
            Init.getPackage();
            JSONObject jSONObject = new JSONObject();
            JSONObject jSONObject2 = new JSONObject();
            StringBuilder sb = new StringBuilder();
            sb.append(this.h);
            sb.append(C0002.m6(f10short, 119, 16, 2077));
            sb.append(list.get(0));
            String sb2 = sb.toString();
            JSONObject jSONObject3 = new JSONObject(fP.oq(sb2, h(sb2))).getJSONArray(m302).getJSONObject(0);
            jSONObject.put(m35, jSONObject3.getString(m35));
            jSONObject.put(m41, jSONObject3.getString(m41));
            jSONObject.put(m32, jSONObject3.getString(m32));
            jSONObject.put(C0007.m26(f10short, 135, 9, 592), jSONObject3.getString(C0014.m43(f10short, 144, 9, 1506)));
            jSONObject.put(m432, jSONObject3.getString(m432));
            jSONObject.put(m30, jSONObject3.getString(m30));
            jSONObject.put(m27, jSONObject3.getString(m27));
            jSONObject.put(m1, jSONObject3.getString(m1));
            jSONObject.put(m3, jSONObject3.getString(m3));
            jSONObject.put(m47, "" + jSONObject3.getString(m47));
            jSONObject.put(m43, jSONObject3.getString(m43));
            jSONObject.put(m17, jSONObject3.getString(m17));
            JSONArray jSONArray = new JSONArray();
            jSONArray.put(jSONObject);
            jSONObject2.put(m302, jSONArray);
            return jSONObject2.toString();
        } catch (Throwable th) {
            return "";
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:42:0x0063, code lost:
    
        return;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void init(android.content.Context r10, java.lang.String r11) {
        /*
            r9 = this;
            r8 = 2
            r7 = 1
            r6 = 0
            r0 = 0
            java.lang.String r1 = "ۧۥۥ"
            r2 = r0
            r3 = r0
            r4 = r0
            r5 = r1
            r1 = r0
        Lb:
            int r5 = com.github.catvod.parser.C0006.m20(r5)
            switch(r5) {
                case 1746786: goto L35;
                case 1747775: goto L19;
                case 1748647: goto L52;
                case 1749756: goto L1e;
                case 1751594: goto L26;
                case 1752547: goto L40;
                case 1752584: goto L63;
                case 1753508: goto L5e;
                case 1754536: goto L2b;
                case 1754567: goto L4c;
                case 1754601: goto L30;
                case 1755492: goto L57;
                case 1755553: goto L45;
                default: goto L12;
            }
        L12:
            java.lang.String[] r1 = r11.split(r4)
            java.lang.String r5 = "ۡ۠ۦ"
            goto Lb
        L19:
            r4 = r1[r7]
            java.lang.String r5 = "ۤۢۨ"
            goto Lb
        L1e:
            java.lang.String r11 = new java.lang.String
            r11.<init>(r3)
            java.lang.String r5 = "ۦۢ۠"
            goto Lb
        L26:
            r9.V0 = r4
            java.lang.String r5 = "ۥۢ۠"
            goto Lb
        L2b:
            r9.j = r0
            java.lang.String r5 = "ۥۣۦ"
            goto Lb
        L30:
            r9.h = r11
            java.lang.String r5 = "ۣ۠ۢ"
            goto Lb
        L35:
            r4 = 153(0x99, float:2.14E-43)
            r5 = 1774(0x6ee, float:2.486E-42)
            java.lang.String r4 = com.github.catvod.parser.C0006.m18(r2, r4, r8, r5)
            java.lang.String r5 = "۠ۨۧ"
            goto Lb
        L40:
            r0 = r1[r8]
            java.lang.String r5 = "ۧۤۥ"
            goto Lb
        L45:
            java.lang.String r4 = r11.substring(r7)
            java.lang.String r5 = "ۨۤ۠"
            goto Lb
        L4c:
            super.init(r10, r11)
            java.lang.String r5 = "ۨۦ۟"
            goto Lb
        L52:
            r11 = r1[r6]
            java.lang.String r5 = "ۧۦۨ"
            goto Lb
        L57:
            byte[] r3 = android.util.Base64.decode(r4, r6)
            java.lang.String r5 = "ۢۥ۟"
            goto Lb
        L5e:
            short[] r2 = com.github.catvod.spider.AI.f10short
            java.lang.String r5 = "۟ۢۥ"
            goto Lb
        L63:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.github.catvod.spider.AI.init(android.content.Context, java.lang.String):void");
    }

    public String playerContent(String str, String str2, List<String> list) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put(C0015.m47(f10short, 155, 7, 2304), this.j);
            JSONObject jSONObject2 = new JSONObject();
            boolean contains = str2.contains(C0017.m52(f10short, 162, 5, 1465));
            String m52 = C0017.m52(f10short, 167, 6, 1448);
            String m17 = C0005.m17(f10short, 173, 6, 1156);
            String m27 = C0008.m27(f10short, 179, 3, 966);
            String m30 = C0009.m30(f10short, 182, 5, 1945);
            int i = 1616;
            while (true) {
                i ^= 1633;
                switch (i) {
                    case 14:
                    case 49:
                        i = !contains ? 1709 : 1678;
                    case 204:
                        boolean contains2 = str2.contains(C0004.m12(f10short, 187, 4, 1414));
                        int i2 = 1740;
                        while (true) {
                            i2 ^= 1757;
                            switch (i2) {
                                case 17:
                                    i2 = contains2 ? 1833 : 1802;
                                case 54:
                                case 471:
                                    jSONObject2.put(C0005.m17(f10short, 191, 2, 965), 1);
                                    jSONObject2.put(m30, 0);
                                    jSONObject2.put(m27, str2);
                                    boolean contains3 = this.j.contains(m17);
                                    int i3 = 48767;
                                    while (true) {
                                        i3 ^= 48784;
                                        switch (i3) {
                                            case 14:
                                                break;
                                            case 45:
                                                break;
                                            case 76:
                                                jSONObject2.put(m52, jSONObject.toString());
                                                break;
                                            case 239:
                                                if (contains3) {
                                                    break;
                                                } else {
                                                    i3 = 48860;
                                                }
                                            default:
                                                continue;
                                        }
                                        i3 = 48829;
                                    }
                                    break;
                                case 500:
                                    int i4 = 1864;
                                    while (true) {
                                        i4 ^= 1881;
                                        switch (i4) {
                                            case 17:
                                                i4 = 48674;
                                                continue;
                                            case 47483:
                                                break;
                                            default:
                                                continue;
                                        }
                                    }
                                    break;
                            }
                        }
                        break;
                    case 239:
                        break;
                }
                return jSONObject2.toString();
            }
            jSONObject2.put(m30, 0);
            jSONObject2.put(m27, str2);
            boolean contains4 = this.j.contains(m17);
            int i5 = 48891;
            while (true) {
                i5 ^= 48908;
                switch (i5) {
                    case 22:
                    case 53:
                        break;
                    case 503:
                        i5 = !contains4 ? 49635 : 48953;
                    case 32495:
                        jSONObject2.put(m52, jSONObject.toString());
                        break;
                }
            }
            return jSONObject2.toString();
        } catch (Throwable th) {
            return "";
        }
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:6:0x0083. Please report as an issue. */
    public String searchContent(String str, boolean z) {
        String m9 = C0003.m9(f10short, 193, 11, 2086);
        String m43 = C0014.m43(f10short, 204, 7, 2186);
        String m17 = C0005.m17(f10short, 211, 8, 1345);
        String m1 = C0000.m1(f10short, 219, 6, 1488);
        String m172 = C0005.m17(f10short, 225, 4, 2245);
        try {
            JSONObject jSONObject = new JSONObject();
            String str2 = this.h + C0000.m1(f10short, 229, 18, 1919) + str;
            System.out.println(str2);
            String oq = fP.oq(str2, h(str2));
            JSONArray jSONArray = new JSONArray();
            JSONArray jSONArray2 = new JSONObject(oq).getJSONArray(m172);
            int i = 0;
            while (true) {
                int length = jSONArray2.length();
                int i2 = 1616;
                while (true) {
                    i2 ^= 1633;
                    switch (i2) {
                        case 14:
                        case 49:
                            i2 = i < length ? 1709 : 1678;
                        case 204:
                            JSONObject jSONObject2 = jSONArray2.getJSONObject(i);
                            JSONObject jSONObject3 = new JSONObject();
                            jSONObject3.put(m1, jSONObject2.getString(m1));
                            jSONObject3.put(m17, jSONObject2.getString(m17));
                            jSONObject3.put(m43, jSONObject2.getString(m43));
                            jSONObject3.put(m9, jSONObject2.getString(m9));
                            jSONArray.put(jSONObject3);
                            int i3 = i + 1;
                            int i4 = 1740;
                            while (true) {
                                i4 ^= 1757;
                                switch (i4) {
                                    case 17:
                                        i4 = 1771;
                                        break;
                                    case 54:
                                        break;
                                }
                            }
                            i = i3;
                            break;
                        case 239:
                            break;
                    }
                    jSONObject.put(m172, jSONArray);
                    return jSONObject.toString();
                }
            }
        } catch (Throwable th) {
            return "";
        }
    }
}
